package com.kingwang.training.designpattern.factorymethod;

import com.kingwang.training.designpattern.factorymethod.sms.SmsSender;
import com.kingwang.training.designpattern.factorymethod.sms.factory.ShandongSmsSenderFactory;
import com.kingwang.training.designpattern.factorymethod.sms.factory.SmsSenderFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application implements ApplicationRunner {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        SmsSenderFactory factory = new ShandongSmsSenderFactory();

        SmsSender smsSender = factory.create();

        smsSender.send("msg");
    }
}
